// ignore_for_file: must_be_immutable, prefer_typing_uninitialized_variables

import 'package:aitao_flutter/style/radius_style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../style/color_style.dart';

class ConfirmButton extends StatelessWidget {
  ConfirmButton(
      {Key? key,
      required this.title,
      this.fontSize = 16,
      this.titleColor = ColorStyle.normalTextColor,
      this.callBack,
      this.isClick = true,
      this.backGroundColor = ColorStyle.whiteColor,
      this.borderRaduis = 22,
      this.leftMargin = 0,
      this.rightMargin = 0})
      : super(key: key);
  String title;
  Color titleColor;
  double fontSize;
  double borderRaduis;
  var isClick;
  final callBack;
  int leftMargin;
  int rightMargin;
  Color backGroundColor;
  @override
  Widget build(BuildContext context) {
    return Align(
      alignment: Alignment.center,
      child: GestureDetector(
        child: Container(
            height: 44.h,
            width: double.infinity,
            margin: EdgeInsets.only(left: leftMargin.w, right: rightMargin.w),
            decoration: BoxDecoration(
                borderRadius: RadiusStyle.radiusAll(borderRaduis),
                color: backGroundColor),
            child: Center(
                child: Text(
              title,
              style: TextStyle(fontSize: fontSize, color: titleColor),
            ))),
        onTap: () {
          if (isClick) {
            callBack();
          }
        },
      ),
    );
  }
}
